package com.funtonow.jqdk.adapter;

import android.widget.CheckBox;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.funtonow.jqdk.R;
import com.funtonow.jqdk.bean.DataStringBean;

/**
 * @author Jiajien
 * @date 2019/6/25
 */
public class UserCheckboxAdapter extends BaseQuickAdapter<DataStringBean, BaseViewHolder> {


    public UserCheckboxAdapter() {
        super(R.layout.item_chebox_layout);
    }

    @Override
    protected void convert(BaseViewHolder helper, DataStringBean item) {
        helper.setText(R.id.tv_checkbox, item.getName());
        CheckBox checkBox = helper.getView(R.id.checkbox);
        if (item.isCheckbox()) {
            checkBox.setChecked(true);
        } else {
            checkBox.setChecked(false);
        }
    }


}
